# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-kubernetes
_pkgname=kubernetes
pkgver=29.0.0
pkgrel=1
pkgdesc="Official Python client library for kubernetes"
url="https://github.com/kubernetes-client/python"
arch="noarch"
license="Apache-2.0"
depends="
	py3-certifi
	py3-dateutil
	py3-google-auth
	py3-requests
	py3-requests-oauthlib
	py3-six
	py3-urllib3
	py3-websocket-client
	py3-yaml
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="pytest py3-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/k/kubernetes/kubernetes-$pkgver.tar.gz
	assertEquals.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# deselected tests have missing modules
	.testenv/bin/python3 -m \
	pytest --ignore=kubernetes/dynamic/test_client.py \
		--ignore=kubernetes/dynamic/test_discovery.py \
		--ignore=kubernetes/e2e_test \
		kubernetes
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
dc9ac54b848e9537616aca4b1062eaa01a7e8f94c91937593913f8c17947907b4aeede006dda92a4b6d0afb2b04d8a0139b52b776897834dea5466b39267ba3b  py3-kubernetes-29.0.0.tar.gz
c52fee3dd475807594c1ef4689333b6298043b1d5f3a2e59234d5760968f483ac509af65f13bd0c3c621598fe2acf7195e3cd4d9c83910ef7ba3f762c3cbd31f  assertEquals.patch
"
